#pragma once
#include <functional>
#include <nice2d/actions/finitetimeaction.h>
#include <nice2d/interpolator.h>

class InterpolationAction : public FiniteTimeAction
{
public:
    static std::shared_ptr<InterpolationAction> create(InterpolatorType type,
                                                       std::function<void(float)> fn,
                                                       float duration = 3.0f);
public:
    InterpolationAction() = delete;
    InterpolationAction(InterpolatorType type, std::function<void(float)> fn, float duration = 3.0f);
    ~InterpolationAction();
protected:
    void update(float deltaTime)override;
private:
    std::unique_ptr<class InterpolationActionData> data;
};
